ref<-read.table("result_ref_file",sep="\t")
geno<-read.table("genotyping_survival_out.txt",sep=" ",head=T)
i<-1
main<-c()
while(i<nrow(ref))
#while(i<5)
{
	l1<-ref[i,3]-20000
	l2<-ref[i,4]+20000
	l3<-ref[i,2]
	index<-which(geno[,4]>=l1 & geno[,4]<l2  & geno[,1] == l3)
	snps<-geno[index,2]
	tempsnps<-paste(snps, collapse="__")
	concat<-cbind(ref[i,1],tempsnps)
	main<-rbind(main,concat)
	i<-i+1
}
write.table(main,"snps_in_gene.txt",quote=FALSE,sep="\t",col.names=FALSE,row.names=FALSE)
ref[1,]
rownames(ref)<-ref[,1]
ref[1,]
gene<-read.table("gene_survival_out.txt",sep="\t",head=T)
geno<-read.table("genotyping_survival_out.txt",sep=" ",head=T)
geno<-read.table("genotyping_survival_out.txt",sep=" ",head=T)
geno[1,]
rownames(geno)<-gene[,2]
rownames(geno)<-c(gene[,2])
length(c(gene[,2]))
rownames(geno)<-c(geno[,2])
gene1<-merge(ref,gene,by="row.names",all.x=F)
gene1[1,]
i<-1
l1<-gene1[i,4]
l2,-gene1[i,5]
l2<-gene1[i,5]
l1
l2
l3<-gene1[i,3]
index<-which(geno[,4]>=l1 & geno[,4]<l2 & gene[,4] == l3)
index<-which(geno[,4]>=l1 & geno[,4]<l2 & geno[,4] == l3)
index
i<-i+1
l1<-gene1[i,4]
l2,-gene1[i,5]
l2<-gene1[i,5]
l3<-gene1[i,3]
l3
index<-which(geno[,4]>=l1 & geno[,4]<l2 & gene[,4] == l3)
index<-which(geno[,4]>=l1 & geno[,4]<l2 & geno[,4] == l3)
index
index<-which(geno[,4]>=l1 & geno[,4]<l2 )
index
index<-which(geno[,4]>=l1 & geno[,4]<l2  & geno[,1] = l3)
index<-which(geno[,4]>=l1 & geno[,4]<l2  & geno[,1] == l3)
index
i<-1
l1<-gene1[i,4]
l3<-gene1[i,3]
l2<-gene1[i,5]
index<-which(geno[,4]>=l1 & geno[,4]<l2  & geno[,1] == l3)
index
geno1<-geno[index,]
geno1
source("http://bioconductor.org/biocLite.R")
    biocLite("siggenes")
library(siggenes)
dim(geno1)
p<-c(geno1[,7])
qvalue.cal(p)
p.adjust(p)
qvalue.cal(p, version = 2)
?install.packages
install.packages("qvalue")
libraryqvalue)
library(qvalue)
install.packages(qvalue)
install.packages("qvalue", dependencies = TRUE)
install.packages(repos=NULL,pkgs="qvalue_1.26.0.tar.gz")
getwd()
install.packages(repos=NULL,pkgs="qvalue_1.26.0.tar.gz")
getwd()
install.packages(repos=NULL,pkgs="qvalue_1.26.0.tar.gz")
    source("http://bioconductor.org/biocLite.R")
biocLite("qvalue")
library(qvalue)
    source("http://bioconductor.org/biocLite.R")
biocLite("qvalue")
library(tcltk) 
geno1[1,]
dim(geno1)
savehistory("snp_summarize_gene.R")
